]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Build: stop updating timestamp of st.h when not needed
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 1 Jan 2011 15:20:34 +0000 (16:20 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 3 Jan 2011 23:17:26 +0000 (00:17 +0100)
Use the same approach as other generated headers (a temporary file,
compare to the existing, then copy), to avoid touching st.h, so
that other dependent objects are not rebuilt, if not needed.
It should speed up building when switching git branches, as often
config.status or automake are run, causing Makefiles to be recreated.

https://bugzilla.gnome.org/show_bug.cgi?id=638453

.gitignore
src/Makefile-st.am

index 5a035eb4ccd276e4ac2f8b01f0b98153891d88c4..c3669d44ced86c13d4e8aea7fcaecea3e7db681c 100644 (file)
@@ -52,6 +52,8 @@ src/test-recorder
 src/test-recorder.ogg
 src/test-theme
 src/st.h
+src/stamp-st.h
+src/stamp-st.h.tmp
 stamp-h1
 tests/run-test.sh
 xmldocs.make
index 4d5d5476ea7540ad23f0f2530ec268be3d414ec0..579223526329f230fc8cb59fc0019b2996a339bd 100644 (file)
@@ -100,11 +100,16 @@ st_source_h =                                     \
        st/st-widget.h                          \
        $(NULL)
 
-st.h: Makefile
+st.h: stamp-st.h
+       @true
+stamp-st.h: Makefile
        $(AM_V_GEN) (echo "#define ST_H_INSIDE 1";      \
        for name in $(st_source_h); do                  \
          echo "#include <"$$name">";                   \
-       done; echo "#undef ST_H_INSIDE") > st.h.tmp && mv st.h.tmp st.h
+       done; echo "#undef ST_H_INSIDE") > $@.tmp &&  \
+       (cmp -s $@.tmp st.h || cp $@.tmp st.h) &&       \
+       rm -f $@.tmp &&                         \
+       echo timestamp > $(@F)
 
 BUILT_SOURCES += st.h